package com.example.consumer.receiver;

import com.example.consumer.config.RabbitConfig;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;

@Component
public class MsgReceiver {
    @RabbitListener(queues = RabbitConfig.QUEUE_NAME1)
    public static void handleMessage1(Message message, Channel channel){
        System.out.println("msg1 = "+message.getPayload());

    }
    @RabbitListener(queues = RabbitConfig.QUEUE_NAME2)
    public static void handleMessage2(Message message, Channel channel){
        System.out.println("msg2 = "+message.getPayload());

    }
}
